use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "cms_topic")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    /// 名称
    pub name: String,
    /// 描述
    pub description: String,
    /// 图片
    pub image: String,
    /// 图标
    pub icon: String,
    /// 别名
    pub alias: String,
    /// 排序
    pub order: i16,
    /// 发布人id
    pub user_id: i32,
    pub created_at: chrono::NaiveDateTime,
    pub updated_at: chrono::NaiveDateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
